<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "shbb_crop_type".
 *
 * @property integer $id
 * @property string $name
 * @property integer $pid
 * @property string $level
 * @property string $comment
 * @property string $code
 */
class Croptype extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'shbb_crop_type';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['pid','level'], 'integer'],
            [['name', 'comment'], 'string', 'max' => 255],
            [['pid'], 'required']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => '类别ID',
            'name' => '类别名称',
            'pid' => '父类别',
            'level' => '层数',
            'comment' => '备注',
            'code'=>'编号',
        ];
    }
}
